app.controller('QuerenCtrl',function($scope,$localStorage,$http,$location,$window,$state){
	$scope.namedata = $localStorage.cur_user.uname;
	$scope.nowtime = getnowtime();
  $scope.rate = 1;
  $scope.max = 5;
  $scope.isReadonly = false;

  $scope.hoveringOver = function(value) {
    $scope.overStar = value;
    $scope.percent = 100 * (value / $scope.max);
  };

    $http.post(
        $scope.app.backendurl+"tbl-break-down/view-one",
        {    
          'breakdown_id': $state.params.oid,
          'token':$localStorage.token                  

        }
        ).success(function (data) {
            console.log(data);
            if(data.code==0&&data.msg=="读取成功"){ 
              $scope.aaData = data.data; 
            }
            if(data.code==1){             
              alert(data.msg)
                    
            }
            if(data.code==20001&&data.msg=='请先登录'){
              $location.path('access.signin');
            }  
        
       
        }).error(function(data){
          console.log(data);
        })
})

function getnowtime(){
    var getdata = new Date();       
    var year = getdata.getFullYear();
    var day = getdata.getDate();
    var month = getdata.getMonth()+1;
    var hours = getdata.getHours();
    var minutes = getdata.getMinutes();
    var secondes = getdata.getSeconds();
   return getdata = year + "-" + month + "-" + day + " "  + hours + ":" + minutes + ":" + secondes ; 
}